package com.czh.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.czh.subject.infra.basic.mapper.SubjectMappingMapper;
import com.czh.subject.infra.basic.entity.SubjectMapping;
import com.czh.subject.infra.basic.service.SubjectMappingService;
import org.springframework.stereotype.Service;

import java.util.List;
import lombok.RequiredArgsConstructor;

/**
 * 题目分类关系表(SubjectMapping)表服务实现类
 *
 * @author caozaihui
 * @since 2024-08-01 01:25:04
 */
@Service("subjectMappingService")
@RequiredArgsConstructor
public class SubjectMappingServiceImpl extends ServiceImpl<SubjectMappingMapper, SubjectMapping> implements SubjectMappingService {
       
 
        /** 
         * 
         * @param  id 主键
         * @author caozaihui  
         * @description //TODO  通过ID查询单条数据
         * @date 2024-08-01 01:25:04
         * @return 实例对象
         */
        @Override
        public SubjectMapping selectSubjectMappingById (Long id) {
                return baseMapper.selectById(id);
        }
        
        /** 
         * 
         * @param subjectMapping 实例对象
         * @author caozaihui  
         * @description //TODO  分页查询数据
         * @date 2024-08-01 01:25:04
         * @return 实例对象
         */
        @Override
        public List<SubjectMapping> querySubjectMappingList (SubjectMapping subjectMapping) {
            return baseMapper.selectSubjectMappingList(subjectMapping);     
        }
        
        /** 
         * 
         * @param subjectMapping 实例对象
         * @author caozaihui  
         * @description //TODO  新增数据
         * @date 2024-08-01 01:25:04
         * @return 实例对象
         */
        @Override
        public int insert(SubjectMapping subjectMapping) {
               return baseMapper.insert(subjectMapping);
        }
        
        
        /** 
         * 
         * @param subjectMapping 实例对象
         * @author caozaihui  
         * @description //TODO  修改数据并返回
         * @date 2024-08-01 01:25:04
         * @return 实例对象
         */
        @Override
        public int update(SubjectMapping subjectMapping) {
                return  baseMapper.updateById(subjectMapping);
        }
        
        
        /**
         *
         * @param idList 主键
         * @author caozaihui 
         * @description //TODO    通过主键删除数据
         * @date 2024-08-01 01:25:04
         * @return
         */
        @Override
        public int deleteByIds(List<Long> idList) {
            return baseMapper.deleteByIds(idList);
        }

        @Override
        public List<Long> selectLabelBySubjectId(Long id) {
                return baseMapper.selectLabelIdBySubjectId(id);
        }

        @Override
        public List<SubjectMapping> querySubjectLabelIds(SubjectMapping subjectMapping) {
                return baseMapper.selectSubjectMappingList(subjectMapping);
        }
}

